diff options
Diffstat (limited to 'src/routes/invoice/[id]/+layout.server.js')
| -rw-r--r-- | src/routes/invoice/[id]/+layout.server.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/routes/invoice/[id]/+layout.server.js b/src/routes/invoice/[id]/+layout.server.js index e123c7d7..690deda0 100644 --- a/src/routes/invoice/[id]/+layout.server.js +++ b/src/routes/invoice/[id]/+layout.server.js @@ -1,6 +1,14 @@ +import Qr from 'qrcode-svg'; import { get } from '$lib/utils'; export async function load({ params }) { let { id } = params; - return { id, invoice: await get(`/invoice?uuid=${id}`) }; + let invoice = await get(`/invoice?uuid=${id}`); + let svg = new Qr({ + content: invoice.text, + join: true, + container: 'svg-viewbox' + }).svg(); + + return { id, invoice, svg }; } |
